package fr.tocchisu.grepolis.services;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;


import fr.tocchisu.grepolis.model.City;
import fr.tocchisu.grepolis.model.Town;
import fr.tocchisu.grepolis.requests.FarmerRequest;

public class FarmerService extends AbstractService {
	private static final int PERIOD_IN_SECONDS = 60 * 5 + 10;

	public static void main(String... args) {

		ScheduledExecutorService pool = Executors.newScheduledThreadPool(45);
		for (Town town : TOWNS) {
			for (City city : town.getCities()) {
				pool.scheduleAtFixedRate(new FarmerRequest(city), 0, PERIOD_IN_SECONDS, TimeUnit.SECONDS);
			}
		}
		// pool.shutdown();

	}

	protected static String readLine(String prompt) {
		return null;
	}
}
